home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
develop
/
libsrc11.arc
/
WRBYTSCI.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-04-27
|
978b
|
45 lines
/* wrbytsci.c 4.3 */
/*F****************************************************************************
FUNCTION NAME: wrbytsci
ACTION: Writes a character from the SCI serial hardware.
Format of the integer argument passed is:
Bits 15-9 = not used
Bit 8 = ninth data bit
Bits 7-0 = low 8 bits of data
PARAMETERS:
byte_value: value to be output to the SCI port
(can be 8 or 9 bit value).
RETURNS: (void)
******************************************************************************/
#define NINTH_BIT 0x100 /* Ninth data bit */
#include <hc11/io.h>
#include <hc11/sci.h>
#include <hc11/directives.h>
SMALL
void wrbytsci(byte_value)
int byte_value;
{
while ((HC11.SCSRDAT.STATUS & TDRE) == 0)
; /* null statement */
HC11.SCSRDAT.DATAREG = byte_value;
if (byte_value & NINTH_BIT)
HC11.SCCR1 |= T8; /* set the bit */
else
HC11.SCCR1 &= (~T8); /* clear the bit */
} /* end of wrbytsci */